//
//  NSConnection.m
//  VidAgent
//
//  Created by Andre Kasper on 24.05.11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "NSConnection.h"


@implementation NSConnection (NetworkServiceAdditions)

+ (id) networkServiceConnectionWithName:(NSString *) inName
							 rootObject:(id) inRootObject {
    NSSocketPort *port = [[[NSSocketPort alloc] init] autorelease];
    NSConnection *connection = [NSConnection connectionWithReceivePort: port 
                                                              sendPort: nil];
	
	[[NSSocketPortNameServer sharedInstance] registerPort:port 
													 name:inName];
	[connection setRootObject: inRootObject];
	return connection;
}

@end
